<?php
/**
 * @author krku
 */

function smarty_block_dropDownContainer($params, $content, &$smarty, &$repeat) {
	if (!$repeat) {
		if (isset($params['isClose']) && $params['isClose']) {
			$isClose = true;
		} else {
			$isClose = false;
		}

		$id = uniqid();

		$link = $params['title'];

		$ret  = '<div class="panelContentTop">';
		$ret .= '<h2><a href="#" class="' . ($isClose ? '' : 'long') . '" onclick="dropDownChange(this, \'' . $id . '\'); return false;">' . $link . '</a>' . (isset($params['additionalTitle']) ? ' ' . $params['additionalTitle'] : '') . '</h2>';
		$ret .= '</div>';

		$ret .= '<div class="panelContentBody" id="' . $id . '" ' . ($isClose ? 'style="display: none;"' : '') . '>';
		$ret .= $content;
		$ret .= '</div>';

		$ret .= '<div class="panelContentBottom"></div>';

		return $ret;
	}
}
?>